import pygame, sys, math

class Menu(pygame.sprite.Sprite):
    def __init__(self, images, size):
        pygame.sprite.Sprite.__init__(self, self.containers)
        self.images = []
        for image in images:
            newimage = pygame.image.load(image)
            newimage = pygame.transform.scale(newimage, size)
            self.images += [newimage]
        self.frame = 0
        self.maxFrame = len(self.images)-1
        self.waitCount = 0
        self.waitMax = 2
        self.image = self.images[self.frame]
        self.rect = self.image.get_rect()
        
        
    def update(*args):
        self = args[0]
        self.animate()
        
    def fixLocation(self, x, y):
        pass
    
    def animate(self):
        if self.waitCount < self.waitMax:
            self.waitCount += 1
        else:
            self.waitCount = 0
            if self.frame < self.maxFrame:
                self.frame += 1
            else:
                self.frame = 0
            self.image = self.images[self.frame]